package zhishu.iceyyy.com.bxq_2500.base;

import android.app.Application;
import android.content.Context;
import android.support.multidex.MultiDex;


import com.zhy.http.okhttp.OkHttpUtils;

import java.util.concurrent.TimeUnit;

import okhttp3.OkHttpClient;


/**
 * 应用Application类
 *
 * @author 马克的贝壳
 * @data
 */

public class BaseApplication extends Application {

    private static BaseApplication mContext;

//    GnEhaCBZKwws7dVnVdf0BrW2nWG4Kthv
    // 单例模式中获取唯一的ExitApplication 实例
    public static BaseApplication getInstance() {
        return mContext;

    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }

    @Override
    public void onCreate() {
        super.onCreate();
        mContext = this;

        getokhttp();


    }





    public void getokhttp() {
        OkHttpClient okHttpClient = new OkHttpClient.Builder()
//                .addInterceptor(new LoggerInterceptor("TAG"))
                .connectTimeout(3000L, TimeUnit.MILLISECONDS)
                .readTimeout(3000L, TimeUnit.MILLISECONDS)
                //其他配置
                .build();

        OkHttpUtils.initClient(okHttpClient);
    }

}
